import React from "react";
import { Flex, Tag } from "antd";
export default function RelationSingleOptions(props) {
  const { control, value } = props;

  //单选关联
  let SingleOptions = [];
  //json 解析
  try {
    SingleOptions = value ? JSON.parse(value) : [];
  } catch (error) {
    console.error("无效的关联JSON数据:", error);
    return <div>组件解析异常.</div>;
  }

  return (
    <div>
      {SingleOptions[0]?.name && (
        <Tag color="processing">{SingleOptions[0].name}</Tag>
      )}
    </div>
  );
}
